<template>
  <div class="dashboard-editor-container">
    <github-corner class="github-corner" />

    <panel-group  />

    <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;text-align: center;">
      <h1 style="color: plum;">热搜技术词汇趋势走向</h1>
      <line-chart :chart-data="wordData" />
    </el-row>

    <el-row :gutter="32">

      <el-col :xs="24" :sm="24" :lg="10">
        <div class="chart-wrapper">
            <h1 style="color: orange;text-align: center;">订单比例</h1>
          <pie-chart />
        </div>
      </el-col>
      <el-col :xs="24" :sm="24" :lg="14">
        <div class="chart-wrapper">
           <h1 style="color: coral;text-align: center;">资料类型</h1>
          <bar-chart />
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import GithubCorner from '@/components/GithubCorner'
import PanelGroup from './components/PanelGroup'
import LineChart from './components/LineChart'
import RaddarChart from './components/RaddarChart'
import PieChart from './components/PieChart'
import BarChart from './components/BarChart'
import TodoList from './components/TodoList'
import BoxCard from './components/BoxCard'
import { lineWords} from '@/api/good'

export default {
  name: 'DashboardAdmin',
  components: {
    GithubCorner,
    PanelGroup,
    LineChart,
    RaddarChart,
    PieChart,
    BarChart,
    TodoList,
    BoxCard
  },
  data() {
    return {
      wordData: {
        wordList:[],
        scoreList:[]
      }
    }
  },
  created() {
    this.lineWords()
  },
  methods: {

    async lineWords() {
      const res = await lineWords()
     this.wordData.wordList = res.data.wordList
     this.wordData.scoreList=res.data.scoreList

    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  position: relative;

  .github-corner {
    position: absolute;
    top: 0px;
    border: 0;
    right: 0;
  }

  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
}

@media (max-width:1024px) {
  .chart-wrapper {
    padding: 8px;
  }
}
</style>
